package cn.hg.solon.youcan.system.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class SysRoleDeptMappingTableDef extends TableDef {

    /**
     * 实体类。

 @author 胡高
 @since 2023-06-20
     */
    public static final SysRoleDeptMappingTableDef SYS_ROLE_DEPT_MAPPING = new SysRoleDeptMappingTableDef();

    /**
     * ID
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 部门ID，关联sys_dept表的ID
     */
    public final QueryColumn DEPT_ID = new QueryColumn(this, "dept_id");

    /**
     * 角色ID，关联sys_role表的ID
     */
    public final QueryColumn ROLE_ID = new QueryColumn(this, "role_id");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, DEPT_ID, ROLE_ID};

    public SysRoleDeptMappingTableDef() {
        super("", "sys_role_dept_mapping");
    }

    private SysRoleDeptMappingTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public SysRoleDeptMappingTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new SysRoleDeptMappingTableDef("", "sys_role_dept_mapping", alias));
    }

}
